package com.cskaoyan.controller.backStage;


import com.cskaoyan.model.vo.BaseRespVO;
import com.cskaoyan.model.vo.TotalV0;
import com.cskaoyan.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
// 不授权
/**
 * @description：完成首页功能
 * @author     ：huzhouming
 * @date       ：2022/5/5 17:08
 */

@RestController
public class DashboardController {
 @Autowired
 DashboardService dashboardService;

   @GetMapping("admin/dashboard")
   /**
    * @author: huzhouming
    * @description: 返回首页所需BaseRespVO对象
    * @date: 2022/5/5
    * @param
    * @return com.cskaoyan.model.vo.BaseRespVO
    */
    public BaseRespVO dashboard(){
       BaseRespVO<TotalV0> baseRespVO = new BaseRespVO<>();
       TotalV0 totalV0 = dashboardService.getDataTotal();
       baseRespVO.setData(totalV0);
       baseRespVO.setErrmsg("成功");
       return baseRespVO;
   }
}
